'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
    async topBar() {
        const { ctx, service } = this;
        const result = await service.home.getTopBar();
        ctx.cc(result);
    }

    async homeData() {
        const { ctx, service } = this;
        const { top_id, page_num } = ctx.params;
        const result = await service.home.getHomeData(top_id, page_num);
        ctx.cc(result);
    }
}

module.exports = HomeController;
